<% use_page_title "Page Routes" %>
<%= render layout: 'page_title' do %>
    <%= button_menu :top do %>
        <div class="btn-group right">
          <%= link_to("View Rails Routes", routes_path, :class => "btn btn-primary btn-small") %>
        </div>
        <%= link_to "Add", new_page_route_path, class: 'btn btn-primary btn-small right' %>
    <% end %>
<% end %>
<%= render layout: 'main_content' do %>
  <table class="data table table-bordered table-rounded table-hover table-striped">
	<thead>  
	    <tr>
	      <th>Name</th>
          <th>Pattern</th>
          <th>Actions</th>
	    </tr>
	</thead>
    <% @page_routes.each do |page_route| %>
      <tr>
        <td><%= page_route.name %></td>
        <td><%= page_route.pattern %></td>
        <td>
          <%= link_to "Edit", edit_polymorphic_path(page_route), class: "btn btn-mini" %>
          <%= link_to "Delete", polymorphic_path(page_route), class: "btn btn-mini btn-danger", method: 'delete',  data:{confirm: 'Are you sure you want to delete this route?'} %>
        </td>
      </tr>
    <% end %>
  </table>
<% end %>
<% if @page_routes.total_pages > 1 %>
  <%= render_pagination @page_routes, Cms::PageRoute %>
<% end %>
